home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Database How-To / Visual Basic 4 Database - How-to (The Waite Group)(1995).iso / client.fr_ / client.fr
Text File  |  1995-07-05  |  8KB  |  286 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "BIBLIO Client"
  5.    ClientHeight    =   6060
  6.    ClientLeft      =   510
  7.    ClientTop       =   945
  8.    ClientWidth     =   7815
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   8.25
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    Height          =   6465
  19.    Left            =   450
  20.    LinkTopic       =   "Form1"
  21.    ScaleHeight     =   6060
  22.    ScaleWidth      =   7815
  23.    Top             =   600
  24.    Width           =   7935
  25.    Begin VB.CommandButton cmdClose 
  26.       Caption         =   "&Close"
  27.       Height          =   495
  28.       Left            =   4380
  29.       TabIndex        =   17
  30.       Top             =   1260
  31.       Width           =   2535
  32.    End
  33.    Begin VB.CommandButton cmdShowTitles 
  34.       Caption         =   "&Show Titles"
  35.       Height          =   495
  36.       Left            =   4380
  37.       TabIndex        =   16
  38.       Top             =   540
  39.       Width           =   2535
  40.    End
  41.    Begin VB.ListBox lstTitles 
  42.       Height          =   1005
  43.       Left            =   420
  44.       Sorted          =   -1  'True
  45.       TabIndex        =   2
  46.       Top             =   2400
  47.       Width           =   7155
  48.    End
  49.    Begin VB.ListBox lstAuthors 
  50.       Height          =   1395
  51.       Left            =   420
  52.       Sorted          =   -1  'True
  53.       TabIndex        =   0
  54.       Top             =   540
  55.       Width           =   3375
  56.    End
  57.    Begin VB.Label lblComments 
  58.       BackColor       =   &H00C0C0C0&
  59.       Height          =   1335
  60.       Left            =   1560
  61.       TabIndex        =   15
  62.       Top             =   4560
  63.       Width           =   6015
  64.       WordWrap        =   -1  'True
  65.    End
  66.    Begin VB.Label lblNotes 
  67.       BackColor       =   &H00C0C0C0&
  68.       Height          =   195
  69.       Left            =   1560
  70.       TabIndex        =   14
  71.       Top             =   4320
  72.       Width           =   6015
  73.    End
  74.    Begin VB.Label lblDescription 
  75.       BackColor       =   &H00C0C0C0&
  76.       Height          =   195
  77.       Left            =   1560
  78.       TabIndex        =   13
  79.       Top             =   4080
  80.       Width           =   6015
  81.    End
  82.    Begin VB.Label lblSubject 
  83.       BackColor       =   &H00C0C0C0&
  84.       Height          =   195
  85.       Left            =   1560
  86.       TabIndex        =   12
  87.       Top             =   3840
  88.       Width           =   6015
  89.    End
  90.    Begin VB.Label lblYear 
  91.       Alignment       =   2  'Center
  92.       BackColor       =   &H00C0C0C0&
  93.       Height          =   195
  94.       Left            =   6960
  95.       TabIndex        =   11
  96.       Top             =   3600
  97.       Width           =   615
  98.    End
  99.    Begin VB.Label lblPublisher 
  100.       BackColor       =   &H00C0C0C0&
  101.       Height          =   195
  102.       Left            =   1560
  103.       TabIndex        =   10
  104.       Top             =   3600
  105.       Width           =   3795
  106.    End
  107.    Begin VB.Label Label8 
  108.       AutoSize        =   -1  'True
  109.       BackColor       =   &H00C0C0C0&
  110.       Caption         =   "Comments:"
  111.       Height          =   195
  112.       Left            =   420
  113.       TabIndex        =   9
  114.       Top             =   4560
  115.       Width           =   930
  116.    End
  117.    Begin VB.Label Label7 
  118.       AutoSize        =   -1  'True
  119.       BackColor       =   &H00C0C0C0&
  120.       Caption         =   "Notes:"
  121.       Height          =   195
  122.       Left            =   420
  123.       TabIndex        =   8
  124.       Top             =   4320
  125.       Width           =   570
  126.    End
  127.    Begin VB.Label Label6 
  128.       AutoSize        =   -1  'True
  129.       BackColor       =   &H00C0C0C0&
  130.       Caption         =   "Description:"
  131.       Height          =   195
  132.       Left            =   420
  133.       TabIndex        =   7
  134.       Top             =   4080
  135.       Width           =   1035
  136.    End
  137.    Begin VB.Label Label5 
  138.       AutoSize        =   -1  'True
  139.       BackColor       =   &H00C0C0C0&
  140.       Caption         =   "Subject:"
  141.       Height          =   195
  142.       Left            =   420
  143.       TabIndex        =   6
  144.       Top             =   3840
  145.       Width           =   720
  146.    End
  147.    Begin VB.Label Label4 
  148.       AutoSize        =   -1  'True
  149.       BackColor       =   &H00C0C0C0&
  150.       Caption         =   "Year Pub:"
  151.       Height          =   195
  152.       Left            =   5880
  153.       TabIndex        =   5
  154.       Top             =   3600
  155.       Width           =   855
  156.    End
  157.    Begin VB.Label Label3 
  158.       AutoSize        =   -1  'True
  159.       BackColor       =   &H00C0C0C0&
  160.       Caption         =   "Publisher:"
  161.       Height          =   195
  162.       Left            =   420
  163.       TabIndex        =   4
  164.       Top             =   3600
  165.       Width           =   855
  166.    End
  167.    Begin VB.Label Label2 
  168.       AutoSize        =   -1  'True
  169.       BackColor       =   &H00C0C0C0&
  170.       Caption         =   "Titles:"
  171.       Height          =   195
  172.       Left            =   420
  173.       TabIndex        =   3
  174.       Top             =   2160
  175.       Width           =   540
  176.    End
  177.    Begin VB.Label Label1 
  178.       AutoSize        =   -1  'True
  179.       BackColor       =   &H00C0C0C0&
  180.       Caption         =   "Authors:"
  181.       Height          =   195
  182.       Left            =   420
  183.       TabIndex        =   1
  184.       Top             =   240
  185.       Width           =   720
  186.    End
  187. End
  188. Attribute VB_Name = "Form1"
  189. Attribute VB_Creatable = False
  190. Attribute VB_Exposed = False
  191. Option Explicit
  192.  
  193. Private AuthorList As Object
  194. Private Const APP_NAME = "BIBLIO Client"
  195.  
  196. Private Sub cmdShowTitles_Click()
  197.     Dim au As Object
  198.     Dim ti As Object
  199.     Dim n As Integer
  200.     
  201.     On Error GoTo ShowTitlesError
  202.         
  203.     If lstAuthors.ListIndex > -1 Then
  204.         Screen.MousePointer = 11
  205.         lstTitles.Clear
  206.         lblPublisher.Caption = ""
  207.         lblYear.Caption = ""
  208.         lblSubject.Caption = ""
  209.         lblDescription.Caption = ""
  210.         lblNotes.Caption = ""
  211.         lblComments.Caption = ""
  212.         Set au = AuthorList.Item(lstAuthors.ItemData(lstAuthors.ListIndex))
  213.         If au.ReadTitles(BiblioPath()) > 0 Then
  214.             n = 1
  215.             For Each ti In au.Titles
  216.                 lstTitles.AddItem ti.Title
  217.                 lstTitles.ItemData(lstTitles.NewIndex) = n
  218.                 n = n + 1
  219.             Next
  220.         Else
  221.             MsgBox "No titles for this author", vbExclamation, APP_NAME
  222.         End If
  223.     Else
  224.         MsgBox "You have not selected a title", vbExclamation, APP_NAME
  225.     End If
  226.     Screen.MousePointer = 0
  227.     
  228. Exit Sub
  229. ShowTitlesError:
  230.     Screen.MousePointer = 0
  231.     MsgBox Err.Description & " (" & Err.Number & ")", vbExclamation, APP_NAME
  232. Exit Sub
  233.  
  234. End Sub
  235.  
  236. Private Sub Form_Load()
  237.     On Error GoTo LoadError
  238.  
  239.     Me.Show
  240.     Me.Refresh
  241.     Screen.MousePointer = 11
  242.     Set AuthorList = CreateObject("DServer.clsAuthors")
  243.     AuthorList.DatabaseName = BiblioPath()        ' BiblioPath is a function in READINI.BAS
  244.     AuthorList.FillCollection Append:=False
  245.     AuthorList.FillList lstAuthors
  246.     Screen.MousePointer = 0
  247. Exit Sub
  248. LoadError:
  249.     Screen.MousePointer = 0
  250.     MsgBox Err.Description & " (" & Err.Number & ")", vbCritical, APP_NAME
  251. End
  252. End Sub
  253.  
  254. Private Sub lstAuthors_DblClick()
  255.     cmdShowTitles_Click
  256. End Sub
  257.  
  258. Private Sub lstTitles_Click()
  259.     Dim ti As Object
  260.     
  261.     On Error GoTo TitleDetailsError
  262.         
  263.     Screen.MousePointer = 11
  264.     Set ti = AuthorList.Item(lstAuthors.ItemData(lstAuthors.ListIndex)).Titles.Item(lstTitles.ItemData(lstTitles.ListIndex))
  265.     lblPublisher.Caption = ti.PublisherName
  266.     lblYear.Caption = CStr(ti.YearPublished)
  267.     lblSubject.Caption = ti.Subject
  268.     lblDescription.Caption = ti.Description
  269.     lblNotes.Caption = ti.Notes
  270.     lblComments.Caption = ti.Comments
  271.     Screen.MousePointer = 0
  272.     
  273. Exit Sub
  274. TitleDetailsError:
  275.     Screen.MousePointer = 0
  276.     MsgBox Err.Description & " (" & Err.Number & ")", vbExclamation, APP_NAME
  277. Exit Sub
  278.     
  279. End Sub
  280. Private Sub cmdClose_Click()
  281.     End
  282. End Sub
  283.  
  284.  
  285.  
  286.